package org.mklink.util;

import org.mklink.service.IMkLinkService;
import org.mklink.service.impl.DMkLinkServiceImpl;
import org.mklink.service.impl.HMkLinkServiceImpl;
import org.mklink.service.impl.JMkLinkServiceImpl;

/**
 * 创建软件链接实现类工程
 * @Author: wyx
 * @Date: 2023/8/20 19:33
 */
public class MkLinkFactory {
    /**
     * 根据单选框mode的值实例化具体的实现类
     * @param mode J D H
     * @return
     */
    public IMkLinkService getFactory(String mode){
        IMkLinkService mkLinkService = null;
        switch (mode){
            case "J":
                mkLinkService = new JMkLinkServiceImpl();
                break;
            case "D":
                mkLinkService = new DMkLinkServiceImpl();
                break;
            case "H":
                mkLinkService = new HMkLinkServiceImpl();
                break;
            default:
                break;
        }
        return  mkLinkService;
    }
}
